package com.bckj.fastboot.core.extra.stage;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;

@AutoConfiguration
@ConditionalOnProperty(prefix = "fastboot.stage", name = "enabled", havingValue = "true", matchIfMissing = true)
public class FastStageConfiguration {

    @Bean
    public static StageRepository stageRepository() {
        return new StageRepository();
    }

    @Bean
    public static StageBeanRegister stageBeanRegister(@Lazy StageRepository stageRepository) {
        return new StageBeanRegister(stageRepository);
    }
}
